﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ModelLayer;
using System.Reflection;
using ModelAccess;

namespace DataLayer
{
    public class WorkflowHelper : AbstractHelper
    {
        public WorkflowHelper()
            : base("Workflow")
        {

        }
        public WorkflowHelper(AbstractHelper ah) : base("Workflow", ah) { }

        public Workflow getWorkflow(Utente utente, Sessione s)
        {

            Workflow workflow = null;


            workflow = (from u in ctx.Workflow
                        where u.Gruppo.Id == utente.Gruppo.Id && u.StatoSessione.Id == s.StatoSessione.Id
                        select u).FirstOrDefault();


            return workflow;

        }
    }
}
